package com.example.wsappproject.MvpDemo.Data;

import com.example.wsappproject.practice.ArticleEntity;

public class Repository implements IDataSource{

    private static Repository INSTANCE = null;
    private final IDataSource mRemoteDataSource;

    public Repository(IDataSource mRemoteDataSource) {
        this.mRemoteDataSource = mRemoteDataSource;
    }

    @Override
    public void articleList(int currentPage, NetCallBack<ArticleEntity> netCallBack) {
        mRemoteDataSource.articleList(currentPage,netCallBack);
    }

    public static Repository getInstance(RemoteDataSource remoteDataSource){
        if (INSTANCE == null){
            INSTANCE = new Repository(remoteDataSource);
        }
        return INSTANCE;
    }
}
